Skip to content

Fix exclude pattern matching to support directory filtering#22

Merged
dvrkn merged 1 commit intomasterfrom
fix/improve-exclude-pattern-matching
Jul 3, 2025
Merged

Fix exclude pattern matching to support directory filtering#22
dvrkn merged 1 commit intomasterfrom
fix/improve-exclude-pattern-matching

Conversation

@dvrkni
Copy link
Copy Markdown
Collaborator

@dvrkni dvrkni commented Jul 3, 2025

Summary

  • Fixes issue where exclude patterns like --exclude 'configgen' had no effect
  • Enhances exclude pattern matching with multiple matching strategies
  • Applies exclude logic consistently in both sort-only and regular diff modes

Changes

  • Substring matching: --exclude "target" excludes files with "target" anywhere in path
  • Glob pattern matching: --exclude "*.tmp" works against full file paths
  • Path component matching: Matches against individual directories and filenames
  • Comprehensive filename matching: Enhanced pattern matching for file names
  • Consistent application: Works in both sort-only and regular diff workflows

Before vs After

Before (broken):

# This had no effect
./yabe --sort-only -p "**/*.yaml" --exclude "target"

After (working):

# Now excludes all files with "target" in the path
./yabe --sort-only -p "**/*.yaml" --exclude "target"
# Excluded 52 files based on exclude patterns

# Also supports complex patterns
./yabe -p "**/*.yaml" --exclude "*/temp/*" --exclude "build" --exclude "*.secret.yaml"

Test plan

  • All tests pass (23/23)
  • Exclude functionality verified with test files
  • Multiple exclude patterns work correctly
  • Both sort-only and regular modes support exclusions

🤖 Generated with Claude Code

- Add substring matching: --exclude "target" now excludes files with "target" in path
- Add glob pattern matching against full paths
- Add path component matching for directory names
- Add comprehensive filename pattern matching
- Apply exclude logic consistently in both sort-only and regular diff modes

Fixes issue where exclude patterns like --exclude 'configgen' had no effect.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dvrkn dvrkn merged commit 6f28067 into master Jul 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants